home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / program / bumprvsn.lha / BumpRevision10 / DoRevision.ged < prev    next >
Text File  |  1995-09-19  |  3KB  |  99 lines

  1. /** $Revision Header *** Header built automatically - do not edit! ***********
  2.  **
  3.  ** © Copyright Bibbersoft
  4.  **
  5.  ** File             : DoRevision.ged
  6.  ** Created on       : zondag, 10-sep-95
  7.  ** Created by       : Bert Wynants
  8.  ** Current revision : V 1.00
  9.  **
  10.  ** Purpose
  11.  ** -------
  12.  **   C, Asm and catalog File Revision Bump script for Golded.
  13.  **
  14.  ** Date        Author                 Comment
  15.  ** =========   ====================   ====================
  16.  ** 10-sep-95   Bert Wynants           --- Initial release ---
  17.  **
  18.  ** $Revision Header *********************************************************/
  19.  
  20. OPTIONS RESULTS                             /* enable return codes     */
  21.  
  22. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  23.     address 'GOLDED.1'
  24.  
  25. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  26. OPTIONS FAILAT 6                            /* ignore warnings         */
  27. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  28.  
  29. /* ----------------------- INSERT YOUR CODE HERE: -------------------- */
  30.  
  31. 'QUERY CAT'                                          /* query language */
  32.  
  33. if (result = "deutsch") then do
  34.  
  35.    noText    = '"Es ist kein Text im Editor ?!"'
  36.    comment   = '"Kommentar"'
  37. end
  38. else if (result = "français") then do
  39.  
  40.    noText    = '"Pas de texte dans le tampon ?!"'
  41.    comment   = '"Commentaire"'
  42. end
  43. else do
  44.  
  45.    noText    = '"No text in buffer ?!"'
  46.    comment   = '"Comment"'
  47. end
  48.  
  49. 'QUERY ANYTEXT'
  50.  
  51. IF (result = 'TRUE')
  52.   THEN DO                                  /* Only if there is any text */
  53.     'QUERY DOC VAR FILENAME'             /* get current file name */
  54.     'SAVE ALL'
  55.     'PING 9'
  56.     IF ARG(1,'E')
  57.       THEN DO
  58.         IF (upper(ARG(1))="BUMP")
  59.           THEN DO
  60.             'QUERY PATH VAR PATH'
  61.             IF( right( path, 1 ) ~= ':' ) then
  62.                 IF( right( path, 1 ) ~= '/' ) then
  63.                     path = path || '/'
  64.             'REQUEST TITLE="Options" BODY="What kind of revision?" BUTTON="BETA|Final|CANCEL"'
  65.             number = RESULT            /* get the user choice (a textstyle or `cancel' */
  66.             if (number > 0)
  67.               THEN DO
  68.                 if (number = 1)
  69.                   then beta = 'BETA'
  70.                   else beta = ''
  71.  
  72.                 dir = pragma( 'directory', path ) /* goto directory of current file */
  73.                 ADDRESS COMMAND 'C:BumpRevision >nil: BUMP EXISTING '||beta
  74.                 path = pragma( 'directory', dir ) /* go back to original directory */
  75.               END
  76.           END
  77.       END
  78.       ELSE DO
  79.         'REQUEST STRING TITLE=comment'
  80.         comment = RESULT
  81.         ADDRESS COMMAND 'C:BumpRevision >nil: FILE '||FILENAME||' COMMENT "'||comment'"'
  82.       END
  83.     'OPEN AGAIN'
  84.     'PONG 9'
  85.   END
  86.   ELSE                                               /* no text in buffer */
  87.    'REQUEST PROBLEM=' || noText
  88.  
  89. /* -------------------------- END OF YOUR CODE ------------------------ */
  90.  
  91. 'UNLOCK' /* VERY important: unlock GUI */
  92. EXIT
  93.  
  94. SYNTAX:
  95.  
  96. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  97. 'UNLOCK'
  98. EXIT
  99.